<template>
    <el-select
        v-model="statusCode"
        placeholder="请选择"
        @change="select"
    >
        <el-option
        v-for="item in statusList"
        :key="item.value"
        :label="item.label"
        :value="item.value"
        ></el-option>
    </el-select>
</template>

<script lang="ts" setup>
import { ref, computed, watch,defineEmits,onMounted } from "vue";
import goodsJs from "@/commonJs/goods/index.js";


let statusList = ref([
    {
        label: "默认",
        value: "",
    }
]);


onMounted(() => {
    let statusListTemp = goodsJs.getPurchaseOrderStatusList();

    for (let i = 0; i < statusListTemp.length; i++) {
        statusList.value.push({
            label: statusListTemp[i].name,
            value: statusListTemp[i].code,
        });
    }

});


let statusCode = ref("");

let emits = defineEmits(["select"]);

let select = () => {
    emits("select", statusCode.value);
};

</script>